import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JTextField;


public class GraphDrawerButtonPanel extends JPanel {
	public GraphDrawerButtonPanel(GraphDrawerPanel drawer) {
		this.setBackground(Color.white);
		final GraphDrawerPanel drawer2 = drawer;
		final JTextField getEdgeListText = new JTextField();
		getEdgeListText.setPreferredSize(new Dimension(200,25));
		add(getEdgeListText);
		final JButton getEdgeListButton = new JButton();
		getEdgeListButton.setText("OK");
		getEdgeListButton.setBackground(Color.LIGHT_GRAY);
		add(getEdgeListButton);
		getEdgeListButton.addMouseListener(new MouseListener() {
		
			@Override
			public void mouseClicked(MouseEvent arg0) {
				// TODO Auto-generated method stub
				drawer2.setAdjList(new AdjacencyList(getEdgeListText.getText()));
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		
		final Class[] searchStructs = {MyPrimStructure.class, MyPriorityQueue.class, MyStack.class, MyQueue.class};
		final JComboBox searchStructureChooser = new JComboBox(searchStructs);
		add(searchStructureChooser);
		
		final JButton searchButton = new JButton();
		searchButton.setText("Search");
		searchButton.setBackground(Color.LIGHT_GRAY);
		add(searchButton);
		searchButton.addMouseListener(new MouseListener() {
		
			@Override
			public void mouseClicked(MouseEvent arg0) {
				// TODO Auto-generated method stub
				drawer2.setAdjList(new AdjacencyList(getEdgeListText.getText()));
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
	}
}
